package ch.fhnw.qualiscan.application.components;

import ch.fhnw.qualiscan.application.modals.CategoryHelper;
import ch.fhnw.qualiscan.application.modals.DomainHelper;
import ch.fhnw.qualiscan.core.LayoutComponent;
import ch.fhnw.qualiscan.core.libraries.ModalLib;

import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;

import eu.livotov.tpt.i18n.TM;

@SuppressWarnings("serial")
public class InformationBox extends LayoutComponent{

	@Override
	public void buildComponent() {

		VerticalLayout wrapper = new VerticalLayout();
		wrapper.setStyleName("informationBox");
		wrapper.setMargin(true, false, true, false);
		wrapper.setSpacing(true);
		
		Label title = textHelper.strong(TM.get("helper.title"));
		wrapper.addComponent(title);
		
		Button domainHelp = new Button(TM.get("helper.domainhelp"), new Button.ClickListener() {
			public void buttonClick(ClickEvent event) {
				openModal(new DomainHelper());
			}
		});
		domainHelp.setStyleName(Button.STYLE_LINK);
		wrapper.addComponent(domainHelp);
		
		Button categoryHelp = new Button(TM.get("helper.categoryhelp"), new Button.ClickListener() {
			public void buttonClick(ClickEvent event) {
				openModal(new CategoryHelper());
			}
		});
		categoryHelp.setStyleName(Button.STYLE_LINK);
		wrapper.addComponent(categoryHelp);
		
		this.addComponent(wrapper);
		
	}

}
